<template>
  <div class="box" v-loading="loading" style="margin-top:20px;">
    <div class="title">
      最新办结
    </div>
    <div class="contents">
      <el-carousel  type="card" :interval="5000" >
        <el-carousel-item v-for="(item,idx) in data" class="aiMsg-item" >
          <a :href="`https://wz.mala.cn/wz/wzinfo?wid=${item.wid}`" target="_blank">
          <div class="textTitle" style="margin:0 0 10px 0">{{ item.title }}</div>
<!--          <div class="textDesc">{{ item.text }}</div>-->
          <div class="links" v-html="item.l_reply">

          </div>
          </a>
        </el-carousel-item>
      </el-carousel>
    </div>
  </div>
</template>
<style lang="scss" scoped>
::v-deep .el-carousel__container {
  height: 300px;


  .el-carousel__item {
    height: 300px;
  }
}
::v-deep .el-carousel__indicators--outside{
  margin-top:30px !important;
}
.contents {
  .aihot{
    font-size:12px;
    color:#333;
    margin: 7px 0;
  }
  .aiMsg-item {
    margin:20px 0;
    padding: 20px;
    border-radius: 5px;
    background: rgba(237, 242, 253, 1);
    //box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  }

  .textTitle {
    font-size: 16px;
    font-weight: bolder;
    color: #000;
  }
  .links{
    background: #fff;
    padding:10px;
    margin-top:10px;
    border-radius: 5px;
    font-size:14px;
    line-height: 20px;
    overflow: hidden;
    color:#322;
    height:213px;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
  }
  .textDesc {
    color: #999;
    line-height: 20px;
    font-size: 14px;
    //CSS3控制最多显示4行
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
  }
}

.title {
  display: flex;
  align-items: center;
  color: #3779fa;
  font-weight: bolder;
  font-size: 20px;

  svg {
    margin-right: 10px;
  }
}

.box {
  min-height: 300px;
  .title{
    display: flex;
    justify-content: space-between;
    align-items: center;
    >div{
      display: flex;
      align-items: center;
    }
    .date{
      color:#666;
      font-size:12px;
    }
  }
}
</style>

<script>
import { getNewReply } from '@/api/data'

export default {
  name: 'EveryDay',
  data() {
    return {
      loading: true,
      data: []
    }
  },
  created() {
    this.getData()
  },
  methods: {
    getData() {
      getNewReply().then(r => {
        this.loading = false
        this.data = r.data
      })
    }
  }
}
</script>
